This is how to step-by-step create, and customize a Normal Gacha Box.
A Normal Gacha Box differs from the other types by just being an average Gacha box, you pick an entry then roll for a prize no gimmicks.
| Table Name | Purpose |
|---|---|
gacha_shop |
Stores Gacha UI info and general properties. |
gacha_entries |
Defines pulls (single/multi) and prize probabilities. |
gacha_items |
Links prizes to actual items players receive. |
gacha_shop)To start off we must define the basics of our Gacha box.
Example SQL:
INSERT INTO gacha_shop (
min_gr, min_hr, name, url_banner,
url_feature, url_thumbnail,
wide, recommended, gacha_type, hidden
)
VALUES (
0, 0, 'Butter Box',
'http://PUBLICIP:8090/butterboxbanner.png',
'http://PUBLICIP:8090/butterboxthumb.png',
'http://PUBLICIP:8090/butterboxban.png',
true, true, 0, false
);
INSERT INTO gacha_shop ( min_gr, min_hr, name, url_banner, url_feature, url_thumbnail, wide, recommended, gacha_type, hidden ) VALUES ( 0, 0, 'Butter Box', 'http://PUBLICIP:8090/banner.png', 'http://PUBLICIP:8090/feature.png', 'http://PUBLICIP:8090/thumbnail.png', true, true, 0, false );
min_gr: Minimum required
G rank (0 means no restrictions).
min_hr: Minimum required Hunter rank
[HRP] (0 means no restrictions).
Rank Limits
name: Name of the Gacha box.
url_banner: This is the top image after selecting the Gacha box kinda like the title image.
url_feature: This is the image box on the right after selecting the Gacha box used to showcase what’s inside the box.
url_thumbnail: This is the image showed at the start before you select a Gacha box.
wide: True = wide banner; False = no wide banner. (The wide banner is the top showcase Gacha)
recommended: Set to true to give the Gacha box a red recommended box.
gacha_type: This corresponds to what type of Gacha box it is, either Normal, Step-Up or Lottery which are type 0, 1, or 2 respectively.
hidden: Setting this to true will put Normal Gacha boxes on their own page doesn’t really hide it, I haven’t tested the others, when I do I’ll add the info here.

gacha_entries)Next up we have to define the pulls from which the players will choose from:
Single Pull (rolls 1 item):
INSERT INTO gacha_entries (
gacha_id, entry_type, item_type, item_number,
item_quantity, weight, rarity, rolls,
daily_limit, frontier_points
) VALUES (
(SELECT id FROM gacha_shop ORDER BY id DESC LIMIT 1),
0, 19, 1, 0, 0, 0, 1, 0, 0
);
INSERT INTO gacha_entries (
gacha_id, entry_type, item_type, item_number,
item_quantity, weight, rarity, rolls,
daily_limit, frontier_points
) VALUES (
(SELECT id FROM gacha_shop ORDER BY id DESC LIMIT 1), 0, 19, 1, 0, 0, 0, 1, 0, 0
);
Multi Pull (rolls 10 items):
INSERT INTO gacha_entries (
gacha_id, entry_type, item_type, item_number,
item_quantity, weight, rarity, rolls,
daily_limit, frontier_points
) VALUES (
(SELECT id FROM gacha_shop ORDER BY id DESC LIMIT 1),
1, 19, 10, 0, 0, 0, 10, 0, 0
);
INSERT INTO gacha_entries (
gacha_id, entry_type, item_type, item_number,
item_quantity, weight, rarity, rolls,
daily_limit, frontier_points
) VALUES (
(SELECT id FROM gacha_shop ORDER BY id DESC LIMIT 1), 1, 19, 10, 0, 0, 0, 10, 0, 0
);
gacha_id: This links to the Gacha shop entry so leave as 1 for it to autoselect.
entry_type: This is the pull type for Normal Gacha there are only two type 0 and 1. For type 0 it’s single pulls and type 1 is multi.
item_type: (
Item Type) This sets how the player will pay for the roll.
item_number: For Zenny and Gacha this will be used to set the amount it’ll cost for others refer to:
Item ID’s [DECIMAL]
item_quantity: For Zenny and Gacha this stays at 0 but for item currency this sets the amount.
weight: This sets the roll chance but is
UNUSED for this part so leave it as 0.
rarity: This sets the star rarity but is also
UNUSED for this part so leave it as 0.
rolls: This sets the amount of prizes obtained
PER pull in my examples I have singles set to 1 and Multi set to 10.
daily_limit: This sets the daily limit for the entry (good for daily discounted pull)
[UNTESTED] 0=none.
frontier_points: This sets the amount of Frontier Points or enables it
[UNTESTED] [DONT MIX].
Every prize needs two insertions:
INSERT INTO gacha_entries (
gacha_id, entry_type, item_type, item_number, item_quantity,
weight, rarity, rolls, daily_limit, frontier_points
) VALUES (
(SELECT id FROM gacha_shop ORDER BY id DESC LIMIT 1),
100, 0, 0, 0, 25, 25, 0, 0, 0
);
INSERT INTO gacha_entries (
gacha_id, entry_type, item_type, item_number, item_quantity,
weight, rarity, rolls, daily_limit, frontier_points
) VALUES (
(SELECT id FROM gacha_shop ORDER BY id DESC LIMIT 1), 100, 0, 0, 0, 25, 25, 0, 0, 0
);
INSERT INTO gacha_items (
entry_id, item_type, item_id, quantity
) VALUES (
(SELECT id FROM gacha_entries ORDER BY id DESC LIMIT 1),
7, 216, 20
);
INSERT INTO gacha_items (
entry_id, item_type, item_id, quantity
) VALUES (
(SELECT id FROM gacha_entries ORDER BY id DESC LIMIT 1), 7, 216, 20
);
entry_type = 100: Prize definition entry. This stays at 100
weight: Probability factor (higher = common). Leave at 0 for autobalance.
rarity: Star display as seen in the image below. 0 = 1star, 1 = 2stars, 2 = 3stars
item_type = 7: This is the item type for the prize refer to
Item Type.
item_id: This is the item ID for the reward refer to
Item ID’s [DECIMAL]
216).
quantity: Amount of set item to recieve per roll.
To add more prizes just repeat these two steps under “Part 3”.
Always ensure total weights = 100:
| Prize | Weight (probability %) |
|---|---|
| Iron Ore | 25% |
| Whetstone | 25% |
| Steak | 20% |
| Mega Potion | 15% |
| Max Potion | 10% |
| Sprout Ore | 5% |
| Total: | 100% ✅ |
Repeat these steps: if you would like to create more Gacha boxes.
Image hosting: I use pythons py http.server 8090 to host my files so the server can read it (MUST BE HTTP ALSO USE PUBLIC IP INSTEAD OF LAN).
Remove Gacha: To remove a Gacha box run this in the query:
DELETE FROM gacha_shop; DELETE FROM gacha_entries; DELETE FROM gacha_items;
DELETE FROM gacha_shop;DELETE FROM gacha_entries;
DELETE FROM gacha_items;
Then re-insert your Gacha sql.
BEGIN;
WITH current AS (
SELECT id FROM gacha_shop
WHERE recommended = true AND gacha_type = 0
ORDER BY id ASC LIMIT 1
),
next AS (
SELECT id FROM gacha_shop
WHERE gacha_type = 0
AND id > (SELECT id FROM current)
ORDER BY id ASC LIMIT 1
),
first AS (
SELECT id FROM gacha_shop
WHERE gacha_type = 0
ORDER BY id ASC LIMIT 1
),
count_recommended AS (
SELECT COUNT(*) AS cnt FROM gacha_shop WHERE recommended = true AND gacha_type = 0
)
UPDATE gacha_shop
SET
recommended = CASE
-- If a currently recommended exists, disable it
WHEN id = (SELECT id FROM current) THEN false
-- Enable the next one, or loop back to the first if none exist
WHEN id = COALESCE((SELECT id FROM next), (SELECT id FROM first)) THEN true
-- If none are recommended, enable the first one as a fallback
WHEN (SELECT cnt FROM count_recommended) = 0 AND id = (SELECT id FROM first) THEN true
ELSE recommended
END,
wide = CASE
WHEN id = (SELECT id FROM current) THEN false
WHEN id = COALESCE((SELECT id FROM next), (SELECT id FROM first)) THEN true
WHEN (SELECT cnt FROM count_recommended) = 0 AND id = (SELECT id FROM first) THEN true
ELSE wide
END
WHERE gacha_type = 0;
COMMIT;
BEGIN; WITH current AS ( SELECT id FROM gacha_shop WHERE recommended = true AND gacha_type = 0 ORDER BY id ASC LIMIT 1 ), next AS ( SELECT id FROM gacha_shop WHERE gacha_type = 0 AND id > (SELECT id FROM current) ORDER BY id ASC LIMIT 1 ), first AS ( SELECT id FROM gacha_shop WHERE gacha_type = 0 ORDER BY id ASC LIMIT 1 ), count_recommended AS ( SELECT COUNT(*) AS cnt FROM gacha_shop WHERE recommended = true AND gacha_type = 0 ) UPDATE gacha_shop SET recommended = CASE -- If a currently recommended exists, disable it WHEN id = (SELECT id FROM current) THEN false -- Enable the next one, or loop back to the first if none exist WHEN id = COALESCE((SELECT id FROM next), (SELECT id FROM first)) THEN true -- If none are recommended, enable the first one as a fallback WHEN (SELECT cnt FROM count_recommended) = 0 AND id = (SELECT id FROM first) THEN true ELSE recommended END, wide = CASE WHEN id = (SELECT id FROM current) THEN false WHEN id = COALESCE((SELECT id FROM next), (SELECT id FROM first)) THEN true WHEN (SELECT cnt FROM count_recommended) = 0 AND id = (SELECT id FROM first) THEN true ELSE wide END WHERE gacha_type = 0; COMMIT;